#!/bin/bash
set -e

source $(dirname $0)/version

ARCH=${ARCH:-"amd64"}
SUFFIX=""
[ "${ARCH}" != "amd64" ] && SUFFIX="_${ARCH}"

cd $(dirname $0)/../dist

TAG=${TAG:-${VERSION}${SUFFIX}}
REPO=${REPO:-rancher}

if echo $TAG | grep -q dirty; then
    TAG=dev
fi

mkdir -p ../dist/artifacts
tar cvzf ../dist/artifacts/share-mnt-${ARCH}.tar.gz -C ../bin share-mnt

echo Created share-mnt-${ARCH}.tar.gz
